﻿@model IEnumerable<CommonApp.Models.UserRequest>
           
@{
    Layout = "~/Views/Requests/_RequestsLayout.cshtml";
}

<h2>Requests</h2>

<form id="filterForm" method="post" action="/Requests/Index">
    
    <span>First Name: </span>
    <input id="firstName" name="firstName" type="text" value="@ViewBag.FirstName"/>
    <span>Last Name:</span>
    <input id="lastName" name="lastName" type="text" value="@ViewBag.LastName" />
    <br />
    
    <input type="submit" value="Filter" />
</form>

@{
    var grid = new WebGrid(
        source: Model,
        rowsPerPage: 10);
}

@Html.ValidationSummary()

@grid.GetHtml(
    tableStyle: "grid",
    headerStyle: "header",
    rowStyle: "row",
    footerStyle: "footer",
    alternatingRowStyle: "row",
    columns: grid.Columns(
        grid.Column("Id", "Number", style: "textCol"),
        grid.Column("Status", "Status", style: "textCol"),
        grid.Column("FirstName", "Name", style: "textCol"),
        grid.Column("LastName", "Surname", style: "textCol")
))

@section scriptRequests {
    <script src="@Url.Content("~/Scripts/requestsIndex.js")" type="text/javascript"></script>
}
